import { createStore,applyMiddleware,combineReducers} from "redux";
import thunk from "redux-thunk"


function getReducers(){
    let files = require.context('./reducers',true,/\.js$/);
    console.log(files);
    return files.keys().reduce((pre,item)=>{
        let key=item.match(/\.\/(w+)\.js$/)[1];
        pre[key] = files(item).default;
        return pre;
    },{})
}

   let reducer = combineReducers(getReducers())

   const stroe = createStore(reducer,applyMiddleware(thunk));


   export default store;








